# R functions to plot data from the 
# single-producer / single-consumer benchmark

require(lattice)

get_data <- function(filename) {
	d <- read.csv(filename)
	d$meansec <- d$dur/d$count
	d
}

plot_lat <- function(data) {
xyplot(meansec*1000 ~ size/1e3, data, 
       type=c('g','p', 'r'),
       col.line='red', lty=2,
       xlab="Message size (KB)", 
       ylab="Message Latency (ms)")
}

# Run
d <- get_data("data.csv")
print(plot_lat(d))